﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace MethodWorx.CMS.UI.Tests.Helper
{
    public static class DataAnnotationsHelper
    {
        public static void AssertPropertyHasAttribute<T>(object model, string property)
            where T : Attribute
        {
            Assert.IsTrue(model.GetType().GetProperty(property).GetCustomAttributes(true).OfType<T>().Any());
        }
    }
}
